﻿<%@ Page Title="" Language="C#" ValidateRequest="false" MasterPageFile="~/Content/MasterHalfColum.Master" Inherits="System.Web.Mvc.ViewPage<SCS.Core.Models.Collection.CreateCampaignCollection>" %>
<%@ Import Namespace="SCS.Core" %>
<%@ Import Namespace="SCS.Core.Models" %>
<%@ Import Namespace="SCS.Core.ViewModels" %>
<%@ Import Namespace="SCS.Core.Controllers" %>
<%@ Import Namespace="SCSService" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Chiến dịch Giử Email Marketing
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContentLeft" runat="server">
    <%--<style type="text/css">
    .hidden {
    display: none;
    }
    </style>
    <link rel="stylesheet" type="text/css" href="../../Content/jquery-ui.css" />
    <script type="text/javascript" src="/Scripts/jquery.min.js"></script>
    <script type="text/javascript" src="/Scripts/jquery-ui.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $(".tabmenu").removeClass("hidden");
            $(".tabs h2").addClass("hidden");
            $(".tabs").tabs();
        });
    </script>--%>
    <%--<script type="text/javascript">
        $(document).ready(function () {
            var chooseClientID = $("#ClientID_CampaignDetail_validationMessage").html();
            var chooseClientStaff = $("#ArrayStaffClientID_validationMessage").html();
            var chooseTitleCampaign = $("#Name_CampaignDetail_validationMessage").html();
            var chooseUserNameSetting = $("#UserName_MailSettingDetail_validationMessage").html();
            var choosePasswordSetting = $("#Password_MailSettingDetail_validationMessage").html();
            var choosePort = $("#SMTPPort_MailSettingDetail_validationMessage").html();
            var chooseApplyTemplate = $("#Content_TemplateDetailValueINOUT_validationMessage").html();
            var chooseScheduleName = $("#ScheduleName_ScheduleDetail_validationMessage").html();

            var tab1s = $("#tab1s");
            var tab2s = $("#tab2s");
            var tab3s = $("#tab3s");
            var tab4s = $("#tab4s");
            var tab5s = $("#tab5s");
            var tab6s = $("#tab6s");

            tab2s.addClass("hidden");
            tab3s.addClass("hidden");
            tab4s.addClass("hidden");
            tab5s.addClass("hidden");
            tab6s.addClass("hidden");

        });
        function CheckFirst() {
            if (document.all || document.getElementById) {
                document.getElementById('checkFirst').value = "true";
            }
            else {
                document.getElementById('checkFirst').setAttribute("value", "true");
            }
        }
        function CheckDetailClick() {
            var checkFirsts = document.getElementById("checkFirst").value;

            if (checkFirsts.toString() != "true") {
                return;
            }

            var check = false;
            var btnSaveDetail = $("#btnSaveDetail");
            var btnSaveMailSetting = $("#btnSaveMailSetting");
            var btnSaveAttachFile = $("#btnSaveAttachFile");
            var btnSaveTemplate = $("#btnSaveTemplate");
            var btnSaveCustomerList = $("#btnSaveCustomerList");

            var chooseClientID = $("#ClientID_CampaignDetail_validationMessage").html();
            var chooseClientStaff = $("#ArrayStaffClientID_validationMessage").html();
            var chooseTitleCampaign = $("#Name_CampaignDetail_validationMessage").html();

            var chooseUserNameSetting = $("#UserName_MailSettingDetail_validationMessage");
            var choosePasswordSetting = $("#Password_MailSettingDetail_validationMessage");
            var choosePort = $("#SMTPPort_MailSettingDetail_validationMessage");

            var tab1s = $("#tab1s");
            var tab2s = $("#tab2s");
            var tab3s = $("#tab3s");
            var tab4s = $("#tab4s");
            var tab5s = $("#tab5s");
            var tab6s = $("#tab6s");

            var div1s = $("#tab-1");
            var div2s = $("#tab-2");
            var div3s = $("#tab-3");
            var div4s = $("#tab-4");
            var div5s = $("#tab-5");
            var div6s = $("#tab-6");

            if (chooseClientID.toString().indexOf("<span") != -1) {
                check = false;
            }
            else
                check = true;

            if (chooseClientStaff.toString().indexOf("<span") != -1) {
                check = false;
            }
            else
                check = true;

            if (chooseTitleCampaign.toString().indexOf("<span") != -1) {
                check = false;
            }
            else
                check = true;


            if (check) {

                tab1s.removeClass("ui-tabs-selected ui-state-active");
                div1s.addClass("ui-tabs-hide");

                tab2s.removeClass("hidden");
                tab2s.addClass("ui-tabs-selected ui-state-active");
                div2s.removeClass("ui-tabs-hide");

                tab3s.addClass("hidden");
                tab4s.addClass("hidden");
                tab5s.addClass("hidden");
                tab6s.addClass("hidden");
                btnSaveDetail.addClass("hidden");
                btnSaveMailSetting.removeClass("hidden");

                chooseUserNameSetting.addClass("hidden");
                choosePasswordSetting.addClass("hidden");
                choosePort.addClass("hidden");
            }

        }
        function CheckMailSettingClick() {
            var check = false;
            var btnSaveDetail = $("#btnSaveDetail");
            var btnSaveMailSetting = $("#btnSaveMailSetting");
            var btnSaveAttachFile = $("#btnSaveAttachFile");
            var btnSaveTemplate = $("#btnSaveTemplate");
            var btnSaveCustomerList = $("#btnSaveCustomerList");

            var chooseUserNameSettings = $("#UserName_MailSettingDetail_validationMessage");
            var choosePasswordSettings = $("#Password_MailSettingDetail_validationMessage");
            var choosePorts = $("#SMTPPort_MailSettingDetail_validationMessage");

            chooseUserNameSettings.removeClass("hidden");
            choosePasswordSettings.removeClass("hidden");
            choosePorts.removeClass("hidden");

            var chooseUserNameSetting = $("#UserName_MailSettingDetail_validationMessage").html();
            var choosePasswordSetting = $("#Password_MailSettingDetail_validationMessage").html();
            var choosePort = $("#SMTPPort_MailSettingDetail_validationMessage").html();
            var tab1s = $("#tab1s");
            var tab2s = $("#tab2s");
            var tab3s = $("#tab3s");
            var tab4s = $("#tab4s");
            var tab5s = $("#tab5s");
            var tab6s = $("#tab6s");

            var div1s = $("#tab-1");
            var div2s = $("#tab-2");
            var div3s = $("#tab-3");
            var div4s = $("#tab-4");
            var div5s = $("#tab-5");
            var div6s = $("#tab-6");

            if (chooseUserNameSetting.toString().indexOf("<span") != -1) {
                check = false;
            }
            else
                check = true;

            if (choosePasswordSetting.toString().indexOf("<span") != -1) {
                check = false;
            }
            else
                check = true;

            if (choosePort.toString().indexOf("<span") != -1) {
                check = false;
            }
            else
                check = true;


            if (check) {

                tab2s.removeClass("ui-tabs-selected ui-state-active");
                div2s.addClass("ui-tabs-hide");

                tab3s.removeClass("hidden");
                tab3s.addClass("ui-tabs-selected ui-state-active");
                div3s.removeClass("ui-tabs-hide");
                
                tab4s.addClass("hidden");
                tab5s.addClass("hidden");
                tab6s.addClass("hidden");
                btnSaveMailSetting.addClass("hidden");
                btnSaveAttachFile.removeClass("hidden");
            }

        }
        function CheckAttachFileClick() {
            var check = false;
            var btnSaveDetail = $("#btnSaveDetail");
            var btnSaveMailSetting = $("#btnSaveMailSetting");
            var btnSaveAttachFile = $("#btnSaveAttachFile");
            var btnSaveTheme = $("#btnSaveTheme");
            var btnSaveCustomerList = $("#btnSaveCustomerList");

            var chooseApplyTemplates = $("#Content_TemplateDetailValueINOUT_validationMessage");

            var tab1s = $("#tab1s");
            var tab2s = $("#tab2s");
            var tab3s = $("#tab3s");
            var tab4s = $("#tab4s");
            var tab5s = $("#tab5s");
            var tab6s = $("#tab6s");

            var div1s = $("#tab-1");
            var div2s = $("#tab-2");
            var div3s = $("#tab-3");
            var div4s = $("#tab-4");
            var div5s = $("#tab-5");
            var div6s = $("#tab-6");

                tab3s.removeClass("ui-tabs-selected ui-state-active");
                div3s.addClass("ui-tabs-hide");

                tab4s.removeClass("hidden");
                tab4s.addClass("ui-tabs-selected ui-state-active");
                div4s.removeClass("ui-tabs-hide");

                tab5s.addClass("hidden");
                tab6s.addClass("hidden");
                btnSaveAttachFile.addClass("hidden");
                btnSaveTheme.removeClass("hidden");

                chooseApplyTemplates.addClass("hidden");

            }
            function CheckTemplateClick() {
                var check = false;
                var btnSaveDetail = $("#btnSaveDetail");
                var btnSaveMailSetting = $("#btnSaveMailSetting");
                var btnSaveAttachFile = $("#btnSaveAttachFile");
                var btnSaveTheme = $("#btnSaveTheme");
                var btnSaveCustomerList = $("#btnSaveCustomerList");

                var chooseApplyTemplates = $("#Content_TemplateDetailValueINOUT_validationMessage");
                chooseApplyTemplates.removeClass("hidden");

                var chooseApplyTemplate = $("#Content_TemplateDetailValueINOUT_validationMessage").html();

                var tab1s = $("#tab1s");
                var tab2s = $("#tab2s");
                var tab3s = $("#tab3s");
                var tab4s = $("#tab4s");
                var tab5s = $("#tab5s");
                var tab6s = $("#tab6s");

                var div1s = $("#tab-1");
                var div2s = $("#tab-2");
                var div3s = $("#tab-3");
                var div4s = $("#tab-4");
                var div5s = $("#tab-5");
                var div6s = $("#tab-6");

                if (chooseApplyTemplate.toString().indexOf("<span>") != -1) {
                    check = false;
                }
                else
                    check = true;

               
                if (check) {

                    tab4s.removeClass("ui-tabs-selected ui-state-active");
                    div4s.addClass("ui-tabs-hide");

                    tab5s.removeClass("hidden");
                    tab5s.addClass("ui-tabs-selected ui-state-active");
                    div5s.removeClass("ui-tabs-hide");
                                       
                    tab6s.addClass("hidden");
                    btnSaveTheme.addClass("hidden");
                    btnSaveCustomerList.removeClass("hidden");
                }

            }
            function CheckCustomerListClick() {
                var check = false;
                var btnSaveCustomerList = $("#btnSaveCustomerList");
                var btnSave1 = $("#btnSave1");
                var btnSave = $("#btnSave");
//                var chooseScheduleName = $("#ScheduleName_ScheduleDetail_validationMessage").html();

                var tab1s = $("#tab1s");
                var tab2s = $("#tab2s");
                var tab3s = $("#tab3s");
                var tab4s = $("#tab4s");
                var tab5s = $("#tab5s");
                var tab6s = $("#tab6s");

                var div1s = $("#tab-1");
                var div2s = $("#tab-2");
                var div3s = $("#tab-3");
                var div4s = $("#tab-4");
                var div5s = $("#tab-5");
                var div6s = $("#tab-6");

               
                    tab5s.removeClass("ui-tabs-selected ui-state-active");
                    div5s.addClass("ui-tabs-hide");

                    tab6s.removeClass("hidden");
                    tab6s.addClass("ui-tabs-selected ui-state-active");
                    div6s.removeClass("ui-tabs-hide");

                    btnSaveCustomerList.addClass("hidden");
                    btnSave1.addClass("hidden");
                    btnSave.removeClass("hidden");
               
            }
         </script>--%>

    <% Html.EnableClientValidation(); %>   
    <% using (Html.BeginForm("SaveAddCampaignCreate", "Campaign", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {%>
    <div class="box ">
	<h2 class="box-header">Thiết lập Server Email</h2>
    <div class="box-content">               
    <div id="grid">                     
		<table class="display" >
            <tr>                           
            <fieldset>
            <%=Html.Action("CampaignCreateMailSetting")%>
            </fieldset>
            <fieldset>
            <%=Html.Action("CampaignCreateAttachFile")%>
            </fieldset>                           
        </tr>                               
	    </table>
			             
	</div>  <!-- grid -->	
    </div> <%--end box-content--%>
	


    <% } %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContentRight" runat="server">
 
    <div class="box ">
		<h2 class="box-header">Danh sách Email Khách hàng</h2>
		<div class="box-content">
			   <table border="0" class="display" cellpadding="0" cellspacing="0" >
                    <tr>
                        <td>
                            <label class="form-label">Vùng khách hàng: </label>
                        </td>
                        <td>
                             <%
                                 List<SelectListItem> ListClientDrop = new List<SelectListItem>();
                                 ListClientDrop.AddRange(new SelectListItem[] { 
                                new SelectListItem{ Text = "Khách mới", Value = "1" },
                                new SelectListItem{ Text = "Khách Thường xuyên", Value = "0" },
                                 new SelectListItem{ Text="Khách hàng tiềm năng",Value="-1"}
                            });
                            %>
                            <%--(SelectList)ViewData["ListClientDrop"]--%>
                             <%= Html.DropDownList("ClientDrop", ListClientDrop, "--------Nhóm khách hàng--------", new { onchange = "getStaff(this);" })%> 
                             <span style="color:Red;font-weight:bold"><%= Html.ValidationMessageFor(m => m.ClientID_CampaignDetail)%></span>
                             <select id="StaffDrop" style="width:300px">                   
                             </select>
                           
                             
                             <%=Html.HiddenFor(m=>m.ClientID_CampaignDetail) %>
                             <%=Html.HiddenFor(m=>m.ArrayStaffClientID) %>
                        </td>
                    </tr>
                    
                    <tr>
                        <td>
                            <label class="form-label"> Assign To: </label>
                        </td>
                        <td>
                         <%
                                List<SelectListItem> statusChoose = new List<SelectListItem>();
                                statusChoose.AddRange(new SelectListItem[] { 
                                new SelectListItem{ Text = "Active", Value = "1" },
                                new SelectListItem{ Text = "Inactive", Value = "0" },
                                new SelectListItem{ Text="Draft",Value="-1"}
                            });
                            %>
                            <%--(SelectList)ViewData["ListAplinkStaffDrop"]--%>
                            <%=Html.DropDownList("StaffAplink", statusChoose, "---------choose Aplink Staff--------", new { onchange = "setArrayStaffApLink(this);" })%>
                            <%=Html.HiddenFor(m=>m.ArrayStaffAplinkID) %>
                          
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="form-label"> Campaign Status: </label>
                        </td>
                        <td>
                           

                            <%=Html.DropDownListFor(m => m.Status_CampaignDetail, statusChoose)%>
                        </td>
                    </tr>
                  
                </table>
                <table class="display" id="tabledata" >
                                <thead>
					                <tr>
						                <th>
                                            Chọn
                                        </th>   					               
						                <th>
                                        Tên
						                </th>
						
						                <th>
							               Email
						                </th>											                

                                        <th>
                                            Địa chỉ
                                        </th>
                                        
                                        <th>
                                          Số điện thoại
                                        </th>

                                        <th>
                                            Trạng thái
                                        </th>
                                        <th>
                                            Quốc giá
                                        </th>
                                       
                                        
					                </tr>
                       
                               
                                </thead>
                                <tbody>
                                <tr>
						                <td>
                                            Chọn
                                        </td>   					               
						                <td>
                                        Tên
						                </td>
						
						                <td>
							               Email
						                </td>											                

                                        <td>
                                            Địa chỉ
                                        </td>
                                        
                                        <td>
                                          Số điện thoại
                                        </td>

                                        <td>
                                            Trạng thái
                                        </td>
                                        <td>
                                            Quốc giá
                                        </td>
                                       
                                        
					                </tr>
                                    </tbody>
                                </table>
	    </div>
	</div>

</div>
    
</asp:Content>
